package org.sqrd.webserver.util;

import java.io.File;
import java.net.URL;

public class StringUtil {

	public static void main(String[] args) {
	getClass("D:\\ourcomputer\\trunk\\webserver\\bin\\org\\sqrd\\webserver\\implementation\\HelloWorld.class");
	}
	
	public static String getClass(String path){
		File fil = new File(path);
		String pack[] = fil.getAbsolutePath().split("\\\\");
		boolean start=false;
		String mypack = "";
		for(int i=0;i<pack.length;i++){
			System.out.println(pack[i]);
			
			if(start){
				mypack = mypack+pack[i]+".";
			}
			if("bin".equals(pack[i])){
				start = true;
			}
		}
		System.out.println("SIVA "+mypack);
		mypack = mypack.substring(0,mypack.length()-7);
		System.out.println(mypack);
		return mypack;
	}

}
